<script setup lang="ts">
import { ref } from 'vue'

const OnlineList = ref({
  title: '在线音乐',
  list: [
    {
      name: '推荐',
      path: '/recommand',
      iconClass: 'iconfont icon-lv_recommend_new'
    },
    {
      name: '音乐馆',
      path: '/musicShop',
      iconClass: 'iconfont icon-lv_music_hall'
    },
    {
      name: '视频',
      path: '/video',
      iconClass: 'iconfont icon-lv_vedio'
    },
    {
      name: '雷达',
      path: '/musicRadar',
      iconClass: 'iconfont icon-lv_radio'
    }
  ]
})

</script>

<template>
  <div class="nav">
    <dl>
      <dt><span  class="left-dt">{{ OnlineList.title }}</span></dt>
      <dd v-for="item in OnlineList.list" :key="item.name">
        <router-link :to="item.path">
          <i :class="item.iconClass"></i><span>{{ item.name }}</span>
        </router-link>
      </dd>
    </dl>
  </div>
</template>

<style lang="scss" scoped>
dt {
  width: 200px;

  .left-dt {
    margin-left: 40px;
    display: inline-block;
    font-size: 12px;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 320;

  }
}
dd {
  display: inline-block;
  margin-left: 20px;

  /*margin-top: 5px;*/

  span{
    height: 30px;
    display: inline-block;
    line-height: 30px;
  }

}

a{
  display: flex;
  align-items: center;
  width: 150px;
  height: 30px;
  text-decoration: none;
  color: black;
  font-size: 14px;
  padding-left: 20px;
  margin-top: 5px;
  margin-bottom: 5px;
  line-height: 30px;
  border-radius: 5px;


  &:hover{
    background-color: var( --color-bg-hover);
  }

  &.active{
    //background-color: #1ecf9d;
    background: var(--color-bg-active);
    color: white;
  }

  .iconfont{
    margin-right: 8px;
    font-size: 20px;
  }

}
</style>